﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Acoris.Rendering
{
    using Acoris.Document;
    using Acoris.Media;

#if WIN2D
    using System.Numerics;

    using Microsoft.Graphics.Canvas;
    using Microsoft.Graphics.Canvas.Brushes;
    using Microsoft.Graphics.Canvas.Geometry;
    using Microsoft.Graphics.Canvas.Text;
#endif
    /// <summary>
    /// 表示一个创建绘图资源的资源工厂接口
    /// </summary>
    public interface IDrawingResourceFactory
    {
#if WIN2D
        /// <summary>
        /// 
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="width"></param>
        /// <param name="height"></param>
        /// <returns></returns>
        CanvasGeometry CreateRectangle(float x, float y, float width, float height);

       /// <summary>
       /// 
       /// </summary>
       /// <param name="x"></param>
       /// <param name="y"></param>
       /// <param name="width"></param>
       /// <param name="height"></param>
       /// <param name="radiusX"></param>
       /// <param name="radiusY"></param>
       /// <returns></returns>
        CanvasGeometry CreateRoundedRectangle(float x, float y, float width, float height, float radiusX, float radiusY);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="pos"></param>
        /// <param name="radiusX"></param>
        /// <param name="radiusY"></param>
        /// <returns></returns>
        CanvasGeometry CreateEllipse(Vector2 pos, float radiusX, float radiusY);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        /// <param name="radiusX"></param>
        /// <param name="radiusY"></param>
        /// <returns></returns>
        CanvasGeometry CreateEllipse(float x, float y, float radiusX, float radiusY);

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        CanvasGeometry CreatePath();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        CanvasGeometry CreatePolygon();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        CanvasGeometry CreateLine();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        CanvasGeometry CreateInk();

        /// <summary>
        /// 
        /// </summary>
        /// <param name="brush"></param>
        /// <returns></returns>
        ICanvasBrush GetBrush(Brush brush);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="format"></param>
        /// <returns></returns>
        CanvasTextFormat GetTextFormat(RenderFormat format);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="strokeStyle"></param>
        /// <returns></returns>
        CanvasStrokeStyle GetStrokeStyle(StrokeStyle strokeStyle);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="text"></param>
        /// <param name="textFormat"></param>
        /// <returns></returns>
        CanvasTextLayout CreateTextLayout(string text, CanvasTextFormat textFormat);
        
#endif

        /// <summary>
        /// gets or sets drawing-context
        /// 获取或设置绘图上下文
        /// </summary>
#if WIN2D
        CanvasDrawingSession
#else
        object
#endif
        DrawingContext { get; set; }

        /// <summary>
        /// gets the drawing device
        /// </summary>
#if WIN2D
        ICanvasResourceCreator
#else
        object
#endif
        Device { get; }
    }
}
